#!/usr/bin/env python
# Author: iris

PKG = 'sound_localization'

import roslib; roslib.load_manifest(PKG)
import rospy

from std_msgs.msg import String

class SoundLocSubscriber():
    def __init__(self):
        rospy.Subscriber("/sound_sources", String, self.callback)
        rospy.init_node('sls_node', anonymous=True)
        rospy.spin()

    def callback(self,data):
        try:
            print "subscriber just received " + data.data
        except rospy.ServiceException, e:
            print "Reply failed: %s"%e

if __name__ == '__main__':
    try:
        r = SoundLocSubscriber()
    except rospy.ROSInterruptException: pass


# roscore
# roslaunch sound_localization localization_demo.launch

